// app.js
App({
  onLaunch() {
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)
    // 监听隐私接口需要用户授权事件
    if (wx.onNeedPrivacyAuthorization) {
      wx.onNeedPrivacyAuthorization(resolve => {
        // 需要用户同意隐私授权时，弹出开发者自定义的隐私授权弹窗
        this.globalData.showPrivacy = true;
        this.globalData.resolvePrivacyAuthorization = resolve
      })
    }

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })
  },
  globalData: {
    userInfo: null,
    latitude : "",
    longitude : "",
    networkList:[],
    isadmin: 0,
    showPrivacy: false,
    openid:"",
    phonenum: "18982556976",
    user_id: "u016078weixinGYNSH",
    loginFlag: false
  }
})
